package top.xuziyi.crawler.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import top.xuziyi.common.pojo.CodeDate;
import top.xuziyi.common.pojo.StockCwzb;

import java.util.Date;

public interface StockCwzbDao extends JpaRepository<StockCwzb, CodeDate>
        , JpaSpecificationExecutor<StockCwzb> {

    //根据股票代码查询数据
    @Query(value = "select count(1) from stock_cwzb where symbol = ? AND `date` = ?", nativeQuery = true)
    int findBySymbolAndDate(String symbol, Date date);
}
